﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace Rubbishit
{
    public partial class Form1 : Form
    {

        int temp = 0;


        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            DriveInfo[] drives = DriveInfo.GetDrives();
            label1.Text = "Total Disk Space: " + (drives[0].TotalSize / 1024 / 1024 / 1024) + " GB";
            label2.Text = "Total Free Disk Space: " + (drives[0].TotalFreeSpace / 1024 / 1024 / 1024) + " GB (" + Math.Round((((double)drives[0].TotalFreeSpace / (double)drives[0].TotalSize) * 100)) + "%)";
        }

        private void btnRubbishit_Click(object sender, EventArgs e)
        {
            progressBar1.Maximum = 100;
            progressBar1.Minimum = 0;
            progressBar1.Value = 0;
            progressBar1.Visible = true;

            toolStripStatusLabel1.Text = "Deciding...";
            statusStrip1.Refresh();

            btnRubbishit.Enabled = false;

            switch (temp % 2)
            {
                case 0:

                    

                    for (int i = 0; i < 5; i++){
                        progressBar1.Value += 20;
                        System.Threading.Thread.Sleep(650);
                    }
                    
                    toolStripStatusLabel1.Text = "Done";
                    txtNext.Text = "Kyle";
                    
                    break;
                case 1:

                    for (int i = 0; i < 5; i++)
                    {
                        progressBar1.Value += 20;
                        System.Threading.Thread.Sleep(450);
                    }

                    toolStripStatusLabel1.Text = "Done";
                    txtNext.Text = "Et";
                    
                    break;
            }
            temp = temp + 1;
            progressBar1.Visible = false;
            btnRubbishit.Enabled = true;

        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var appAboutBox = new AboutBox1();
            appAboutBox.ShowDialog();
        }



    }
}
